//
//  JPMGoodsM.swift
//
//  Created by 邱仙凯 on 2022/4/11
//  Copyright (c) . All rights reserved.
//

import Foundation
import ObjectMapper

public struct JPMGoodsM: Mappable {

  // MARK: Declaration for string constants to be used to decode and also serialize.
  private struct SerializationKeys {
    static let rowNum = "row_num"
    static let zProductNo = "z_product_no"
    static let zProductNm = "z_product_nm"
    static let idKey = "id_key"
    static let productDescribe = "product_describe"
    static let zProductAlias = "z_product_alias"
      static let zUnitNm = "z_unit_nm"
      static let productContractId = "product_contract_id"
      static let productContractNm = "product_contract_nm"
      static let productSaleBree = "product_sale_bree"
      static let zUnit = "z_unit"

 
  }

  // MARK: Properties
  public var rowNum: Int?
  public var zProductNo: String?
  public var zProductNm: String?
  public var idKey: String?
  public var productDescribe: String?
  public var zProductAlias: String?

    public var productContractId: String?
    public var productContractNm: String?
    
    public var zUnitNm: String?
    public var zUnit: String?

    public var productSaleBree: String?

  // MARK: ObjectMapper Initializers
  /// Map a JSON object to this class using ObjectMapper.
  ///
  /// - parameter map: A mapping from ObjectMapper.
  public init?(map: Map){

  }

  /// Map a JSON object to this class using ObjectMapper.
  ///
  /// - parameter map: A mapping from ObjectMapper.
  public mutating func mapping(map: Map) {
    rowNum <- map[SerializationKeys.rowNum]
    zProductNo <- map[SerializationKeys.zProductNo]
    zProductNm <- map[SerializationKeys.zProductNm]
    idKey <- (map[SerializationKeys.idKey],StringTransform())
    productDescribe <- map[SerializationKeys.productDescribe]
    zProductAlias <- map[SerializationKeys.zProductAlias]
      
      productContractId <- (map[SerializationKeys.productContractId],StringTransform())
      productContractNm <- map[SerializationKeys.productContractNm]
      zUnitNm <- map[SerializationKeys.zUnitNm]
      productSaleBree <- map[SerializationKeys.productSaleBree]
      zUnit <- (map[SerializationKeys.zUnit],StringTransform())

      
      
  }

  /// Generates description of the object in the form of a NSDictionary.
  ///
  /// - returns: A Key value pair containing all valid values in the object.
  public func dictionaryRepresentation() -> [String: Any] {
    var dictionary: [String: Any] = [:]
    if let value = rowNum { dictionary[SerializationKeys.rowNum] = value }
    if let value = zProductNo { dictionary[SerializationKeys.zProductNo] = value }
    if let value = zProductNm { dictionary[SerializationKeys.zProductNm] = value }
    if let value = idKey { dictionary[SerializationKeys.idKey] = value }
    if let value = productDescribe { dictionary[SerializationKeys.productDescribe] = value }
    if let value = zProductAlias { dictionary[SerializationKeys.zProductAlias] = value }
      
      if let value = productContractId { dictionary[SerializationKeys.productContractId] = value }
      if let value = productContractNm { dictionary[SerializationKeys.productContractNm] = value }
   
       
    return dictionary
  }

}
